package com.capgemini.diabeo.view;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.capgemini.diabeo.R;
import com.capgemini.diabeo.activity.MenuActivity_;
import com.capgemini.diabeo.manager.DishManager;
import com.capgemini.diabeo.manager.SearchManager;
import com.capgemini.diabeo.model.Dish;
import com.capgemini.diabeo.model.Menu;
import com.googlecode.androidannotations.annotations.Bean;
import com.googlecode.androidannotations.annotations.Click;
import com.googlecode.androidannotations.annotations.EViewGroup;
import com.googlecode.androidannotations.annotations.ViewById;

@EViewGroup(R.layout.menu_item)
public class MenuItemView extends LinearLayout {

	@ViewById
	TextView menuTime;
	
	@ViewById
	TextView menuName;

//	@ViewById
//	TextView dishCarbohydrate;
//
//	@ViewById
//	TextView dishIG;
//
//	@ViewById
//	TextView dishLipid;
//
//	@ViewById
//	Button addToMenu;
//
//	@Bean
//	DishManager dishManager;

	private Menu menu;

	private SearchManager searchManager;

	public MenuItemView(Context context) {
		super(context);
	}

	public void bind(Menu menu) {
		this.menu = menu;
		menuName.setText("Menu");
		menuTime.setText(menu.getMealTime());
//		dishCarbohydrate.setText(doubleToString(dish.getCarbohydrate()));
//		dishIG.setText(doubleToString(dish.getIg()));
//		dishLipid.setText(doubleToString(dish.getLipid()));
		
	}
	
	public void setManager(SearchManager manager){
		this.searchManager = manager;
	}

	private String doubleToString(double value) {
		return String.valueOf(value);
	}
	
	public Menu getMenu(){
		return this.menu;
	}

}
